//
// Created by ashCheng on 2022/9/8.
//
#include <iostream>

int main()
{
  int i = 0, &r1 = i;
  double d = 0, &r2 = d;
  r2 = 3.14159;
  std::cout << "r2:" << r2 << std::endl; // 3.14159
  r2 = r1;
  std::cout << "r2:" << r2 << std::endl; // 0
  i = r2;
  std::cout << "i:" << i << std::endl; // 0
  r1 = d;
  std::cout << "r1:" << r1 << std::endl; // 0

  int i2, &ri = i2;
  i2 = 5; ri = 10;
  std::cout << i2 << " " << ri << std::endl;

  bool b1 = false, b2 = true;
  std::cout << "b1: " << b1 << " b2: " << b2 << std::endl;
  std::cout << "result:" << (b1 & b2) << std::endl;
  std::cout << "result:" << (b2 & b1) << std::endl;
  return 0;
}